unit UMyShape;

interface

uses
  System.Classes, System.Types, System.Rtti, System.UITypes, System.UIConsts,
  FMX.Types,FMX.Objects, FMX.Controls, FMX.TextLayout, FMX.Text, FMX.Messages,
  FMX.Platform;

{$SCOPEDENUMS ON}

Type

TMyEllipse = class(TEllipse)
  private
    FText :String;
    FFont :TFont;
    FTextColor:TAlphaColor;
  protected
    procedure Paint; override;
  published
    property Text:string read FText write FText;
    property TextColor: TAlphaColor write FTextColor;
    property Font : TFont write FFont;
  end;

TMyRectAngle = class(TRectAngle)
  private
    FText :String;
    FFont :TFont;
    FTextColor:TAlphaColor;
  protected
    procedure Paint; override;
  published
    property Text:string read FText write FText;
    property TextColor: TAlphaColor write FTextColor;
    property Font : TFont write FFont;
  end;



implementation
{$Region 'TMyEllipse'}

procedure TMyEllipse.Paint;
begin
  inherited Paint;
  Canvas.Fill.Color := self.FTextColor;
  Canvas.Font.Size := FFont.Size;
  Canvas.Font.Family := FFont.Family;
  Canvas.Font.Style := FFont.Style;
  Canvas.FillText(GetShapeRect,FText,True,1,[TFillTextFlag.ftRightToLeft],
         TTextAlign.taCenter,TTextAlign.taCenter);
end;
{$EndRegion}

{$Region 'TMyRectAngle'}

procedure TMyRectAngle.Paint;
begin
  inherited Paint;
  Canvas.Fill.Color := FTextColor;
  Canvas.Font.Size := FFont.Size;
  Canvas.Font.Family := FFont.Family;
  Canvas.Font.Style := FFont.Style;
  Canvas.FillText(GetShapeRect,FText,True,1,[TFillTextFlag.ftRightToLeft],
         TTextAlign.taCenter,TTextAlign.taCenter);
end;
{$EndRegion}

end.
